package com.sias.realestate.web.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sias.realestate.core.generic.GenericDao;
import com.sias.realestate.core.generic.GenericServiceImpl;
import com.sias.realestate.web.dao.OwnerMapper;
import com.sias.realestate.web.model.Owner;
import com.sias.realestate.web.service.OwnerService;

@Service
public class OwnerServiceImpl extends GenericServiceImpl<Owner, Integer> implements OwnerService{

	@Resource
	private OwnerMapper ownermapper;

	@Override
    public int insert(Owner model) {
        return ownermapper.insertSelective(model);
    }

    @Override
    public int update(Owner model) {
        return ownermapper.updateByPrimaryKeySelective(model);
    }

    @Override
    public int delete(Integer id) {
        return ownermapper.deleteByPrimaryKey(id);
    }

    @Override
    public Owner selectById(Integer id) {
        return ownermapper.selectByPrimaryKey(id);
    }
    
	@Override
	public List<Owner> selectList() {
		// TODO Auto-generated method stub		
		return ownermapper.findAll();
	}
	@Override
	public GenericDao<Owner, Integer> getDao() {
		// TODO Auto-generated method stub
		return ownermapper;
	}

	@Override
	public Owner findByIdcard(String oIdcard) {
		// TODO Auto-generated method stub
		return ownermapper.selectByIdcard(oIdcard);
	}

	@Override
	public List<Owner> selectCheckin() {
		// TODO Auto-generated method stub
		return ownermapper.findByStatus();
	}


}
